package com.example.strategy.core;

import com.example.strategy.constant.MsgResult;

public class Order {
    private String uid;
    private String orderId;
    private double amount;

    public Order(String uid,String orderId,double amount){
        this.uid = uid;
        this.orderId = orderId;
        this.amount = amount;
    }
    
    public MsgResult pay(String payMethod){
        
    	ModelTemplates payment = null;
    	if(payMethod.equals("Wechart")) {
    		if("Wechart".equals(payMethod)){
    			payment = new WechartPay();
    		}else {
    			payment = new OtherPay();
    		}

    	}
        System.out.println("欢迎使用" + payment.getName() + "支付");
        System.out.println("本次交易金额为：" + amount + "，开始扣款...");
        // 检查余额 开始扣款
        return payment.pay(uid,amount);
    	
    }
}
